package com.bailong.administrator.ausedcar.ui.buycarsfragment;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.bailong.administrator.ausedcar.config.UrlConfig;

public class BuyCarsActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //创建webview对象
        WebView webView =new WebView(this);

        //设置属性,防止打开自带的浏览器
        webView.setWebViewClient(new WebViewClient());
        //让webview支持alert脚本
        webView.setWebChromeClient(new WebChromeClient());
        //获取webview对象的设置 设置他支持javascript
        webView.getSettings().setJavaScriptEnabled(true);
        //
        webView.loadUrl(UrlConfig.BUYCAR);

        setContentView(webView);
    }
}
